package cn.maihe.elg.operation.centers.epoint.handler.service;

import cn.maihe.elg.operation.centers.epoint.config.EpointCenterInfosConfig;
import cn.maihe.elg.operation.centers.epoint.dto.EpointBaseReqDTO;
import cn.maihe.elg.operation.centers.epoint.dto.EpointBaseRespDTO;
import cn.maihe.elg.operation.centers.epoint.handler.EpointCenterTradeService;
import cn.maihe.elg.operation.centers.supports.CenterTradeContext;
import cn.maihe.elg.operation.centers.supports.annotation.CenterTradeService;
import cn.maihe.elg.operation.model.enums.CenterNoEnum;
import cn.maihe.elg.operation.model.enums.CenterProviderEnum;
import cn.maihe.elg.operation.model.enums.TradeType;
import lombok.extern.slf4j.Slf4j;
import org.springframework.transaction.annotation.Transactional;

/**
 * @Description 心跳
 * @Author SSX
 * @Date 2025/06/09
 */
@CenterTradeService(
        provider = CenterProviderEnum.EPOINT,
        centerNo = CenterNoEnum.MEISHAN,
        tradeType = TradeType.heartbeat,
        reqClass = EpointBaseReqDTO.class,
        respClass = EpointBaseRespDTO.class
)
@Slf4j
public class MeiShanHeartbeatService extends EpointCenterTradeService<EpointBaseReqDTO, EpointBaseRespDTO> {
    public MeiShanHeartbeatService(EpointCenterInfosConfig centerInfosConfig) {
        super(centerInfosConfig);
    }

    /**
     * 具体业务处理
     *
     * @param context
     */
    @Override
    @Transactional(rollbackFor = Exception.class)
    public EpointBaseRespDTO processService(CenterTradeContext<EpointBaseReqDTO, EpointBaseRespDTO> context) {
        return EpointBaseRespDTO.success("心跳正常");
    }
}
